Repository navigation
chore(deployment): Improve build process - #292
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| --arg url "$RUN_URL" --argjson fields "$fields" \ | ||
| '{embeds:[{title:$title,url:$url,color:$color,fields:$fields,timestamp:(now|todate)}]}') | ||
| curl -sf -H "Content-Type: application/json" -X POST -d "$payload" "$DISCORD_WEBHOOK_URL" \ | ||
| || echo "Discord notification failed to send" |
There was a problem hiding this comment.
Just wanted to check if we should use exit 1 here when the Discord notification fails to send. This way, we can at least flag that something went wrong with the webhook, even if the deployment itself was healthy.
If this behavior is intentional, feel free to ignore my comment.
| run: | | ||
| REMOTE_CMD="export HOME=/home/$ROOT_USER && export NVM_DIR="/home/$ROOT_USER/.nvm" && [ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh" && git config --global --add safe.directory ${BUILD_DIRECTORY} && set -e && cd ${BUILD_DIRECTORY} && git pull origin main && npm ci && npm run build && sudo -iu ${ROOT_USER} pm2 restart ${APP_NAME}" | ||
| : "${BUILD_DIRECTORY:?BUILD_DIRECTORY secret is not set}" | ||
| echo "Deploying commit: $DEPLOY_SHA to $BUILD_DIRECTORY" |
There was a problem hiding this comment.
Don't echo build_directory
| REMOTE_CMD="export HOME=/home/$ROOT_USER && export NVM_DIR="/home/$ROOT_USER/.nvm" && [ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh" && git config --global --add safe.directory ${BUILD_DIRECTORY} && set -e && cd ${BUILD_DIRECTORY} && git pull origin main && npm ci && npm run build && sudo -iu ${ROOT_USER} pm2 restart ${APP_NAME}" | ||
| : "${BUILD_DIRECTORY:?BUILD_DIRECTORY secret is not set}" | ||
| : "${ROOT_USER:?USER secret is not set}" | ||
| echo "Deploying commit: $DEPLOY_SHA to $BUILD_DIRECTORY" |
There was a problem hiding this comment.
don't echo build_directory
|
🎉 This PR is included in version 0.5.1-main.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
• CI checks before deployment: On every merge, the CI workflow runs first. The deployment script runs only if all CI checks pass. If the CI fails, the deployment will not proceed.
• Deployment notifications: The deployment status, whether successful or failed, will be notified in Discord.
• SSM deployment status: The CD workflow will proceed only after we receive a successful deployment status from SSM.
Checklist
Before submitting a pull request, please ensure that you mark these task.
npm run devandnpm run buildin the repository root and test.